<template>
    <div>
        <mt-swipe :auto="4000" :style="margintop">
          <mt-swipe-item v-for="(img,index) in imgs" :key="index"><a :href="img.link"><img :src="img.img"></a></mt-swipe-item>
        </mt-swipe>
    </div>
</template>
<script>
    export default {
        data(){
            return {
                imgs:[],//轮播图片列表
                url:'?tbname=relays_data',//'getlunbo', //轮播图url传递到子组件
            }
        },
        props:['margintop'],
        created(){
            this.$ajax.get(this.url)
            .then(res=>{
                this.imgs = res.data.rows;
            })
            .catch(err=>{
                console.log(err);
            })
        }
    }
</script>
<style scoped>
/*轮播图样式*/
.mint-swipe{
    max-height:55px; margin-bottom: 5px; padding-bottom: 5px; margin-top: 50px;
}
.mint-swipe img {
    width:100%;
}
</style>